Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

397
Views
You may need an additional loader to handle the result of these loaders, r = ts(a[0])

I'm using react typescript and simply want to create a select component for a time zone picker. I tried using npm library react-timezone-select. But it is giving the below errors in the console:

index.js:1 ./node_modules/react-timezone-select/dist/esm/index.js 9693:38

Module parse failed: Unexpected token (9693:38)

File was processed with these loaders:

./node_modules/babel-loader/lib/index.js

You may need an additional loader to handle the result of these loaders.

r = ts(a[0]);
let o = "",
s = n.isDST() ? r[0].daylight?.abbr : r[0].standard?.abbr,
l = n.isDST() ? r[0].daylight?.name : r[0].standard?.name;
const u = 60 * t.current.offset,

I can't figure out what am I doing wrong. Can't use npm libraries in react typescript?

I tried installing react-timezone-select using the below commands

npm i react-timezone-select
npm i @types/react-timezone-select

Also, I changed the tsconfig.json file to include

"lib": ["DOM", "ES6", "DOM.Iterable", "ScriptHost", "ES2016.Array.Include", "esnext"],

"include": ["src", "backend", "src/**/*.ts", "src/**/*.tsx"]

but none of it worked and the same error is persistent.

I expected typescript to make life easier but instead, it creates more problems with every other npm library.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It seems updating the react-scripts to 5.0.1 fixes your problem. Refer to this thread https://github.com/ndom91/react-timezone-select/issues/57

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!